.class Les/n40;
.super Ljava/io/InputStream;
.source "Smb2InputStream.java"


# instance fields
.field private final a:Les/td0;

.field private final b:J

.field private c:J

.field private d:J


# direct methods
.method public constructor <init>(Les/sd0;Ljava/lang/String;JJ)V
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    invoke-direct {p0}, Ljava/io/InputStream;-><init>()V

    .line 2
    :try_start_0
    sget-object v0, Lcom/hierynomus/msdtyp/AccessMask;->GENERIC_READ:Lcom/hierynomus/msdtyp/AccessMask;

    invoke-static {v0}, Ljava/util/EnumSet;->of(Ljava/lang/Enum;)Ljava/util/EnumSet;

    move-result-object v0

    sget-object v1, Lcom/hierynomus/smbj/smb2/SMB2CreateDisposition;->FILE_OPEN:Lcom/hierynomus/smbj/smb2/SMB2CreateDisposition;

    invoke-virtual {p1, p2, v0, v1}, Les/sd0;->a(Ljava/lang/String;Ljava/util/EnumSet;Lcom/hierynomus/smbj/smb2/SMB2CreateDisposition;)Les/td0;

    move-result-object p1

    iput-object p1, p0, Les/n40;->a:Les/td0;
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 3
    iput-wide p3, p0, Les/n40;->c:J

    .line 4
    iput-wide p5, p0, Les/n40;->b:J

    const-wide/16 p1, 0x0

    .line 5
    iput-wide p1, p0, Les/n40;->d:J

    .line 6
    new-instance p1, Ljava/lang/StringBuilder;

    invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V

    const-string p2, "readSize:"

    invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1, p5, p6}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    const-string p2, "SMB2"

    invoke-static {p2, p1}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V

    return-void

    .line 7
    :catch_0
    new-instance p1, Ljava/io/IOException;

    invoke-direct {p1}, Ljava/io/IOException;-><init>()V

    throw p1

    :catch_1
    move-exception p1

    .line 8
    throw p1
.end method


# virtual methods
.method public close()V
    .locals 1
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    :try_start_0
    iget-object v0, p0, Les/n40;->a:Les/td0;

    invoke-virtual {v0}, Les/td0;->a()V

    .line 2
    invoke-super {p0}, Ljava/io/InputStream;->close()V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    return-void

    .line 3
    :catch_0
    new-instance v0, Ljava/io/IOException;

    invoke-direct {v0}, Ljava/io/IOException;-><init>()V

    throw v0

    :catch_1
    move-exception v0

    .line 4
    throw v0
.end method

.method public read()I
    .locals 6
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 19
    iget-wide v0, p0, Les/n40;->b:J

    iget-wide v2, p0, Les/n40;->d:J

    sub-long/2addr v0, v2

    const/4 v2, -0x1

    const-wide/16 v3, 0x0

    cmp-long v5, v0, v3

    if-nez v5, :cond_0

    return v2

    :cond_0
    const/16 v0, 0x8

    new-array v0, v0, [B

    const/4 v1, 0x1

    const/4 v3, 0x0

    .line 20
    invoke-virtual {p0, v0, v3, v1}, Les/n40;->read([BII)I

    move-result v1

    if-ne v1, v2, :cond_1

    goto :goto_0

    :cond_1
    aget-byte v0, v0, v3

    and-int/lit16 v2, v0, 0xff

    :goto_0
    if-ltz v2, :cond_2

    .line 21
    iget-wide v0, p0, Les/n40;->d:J

    const-wide/16 v3, 0x1

    add-long/2addr v0, v3

    iput-wide v0, p0, Les/n40;->d:J

    :cond_2
    return v2
.end method

.method public read([B)I
    .locals 2
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 18
    array-length v0, p1

    const/4 v1, 0x0

    invoke-virtual {p0, p1, v1, v0}, Les/n40;->read([BII)I

    move-result p1

    return p1
.end method

.method public read([BII)I
    .locals 12
    .annotation system Ldalvik/annotation/Throws;
        value = {
            Ljava/io/IOException;
        }
    .end annotation

    .line 1
    new-instance v0, Ljava/lang/StringBuilder;

    invoke-direct {v0}, Ljava/lang/StringBuilder;-><init>()V

    const-string v1, "byteOffset:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p2}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    const-string v1, ",byteCount:"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {v0, p3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    const-string v1, "SMB2"

    invoke-static {v1, v0}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V

    if-ltz p2, :cond_5

    if-ltz p3, :cond_5

    add-int v0, p2, p3

    .line 2
    array-length v2, p1

    if-gt v0, v2, :cond_5

    .line 3
    :try_start_0
    iget-wide v2, p0, Les/n40;->b:J

    const-wide/16 v4, 0x0

    cmp-long v0, v2, v4

    if-nez v0, :cond_1

    .line 4
    iget-object v6, p0, Les/n40;->a:Les/td0;

    iget-wide v7, p0, Les/n40;->c:J

    move-object v9, p1

    move v10, p2

    move v11, p3

    invoke-virtual/range {v6 .. v11}, Les/td0;->a(J[BII)I

    move-result p1

    if-ltz p1, :cond_0

    .line 5
    iget-wide p2, p0, Les/n40;->d:J

    int-to-long v0, p1

    add-long/2addr p2, v0

    iput-wide p2, p0, Les/n40;->d:J

    .line 6
    iget-wide p2, p0, Les/n40;->c:J

    add-long/2addr p2, v0

    iput-wide p2, p0, Les/n40;->c:J

    :cond_0
    return p1

    .line 7
    :cond_1
    iget-wide v2, p0, Les/n40;->b:J

    iget-wide v6, p0, Les/n40;->d:J

    sub-long/2addr v2, v6

    cmp-long v0, v2, v4

    if-nez v0, :cond_2

    .line 8
    new-instance p1, Ljava/lang/StringBuilder;

    invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V

    const-string p2, "left:"

    invoke-virtual {p1, p2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    invoke-static {v1, p1}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V

    const/4 p1, -0x1

    return p1

    :cond_2
    int-to-long v4, p3

    cmp-long v0, v4, v2

    if-gez v0, :cond_3

    .line 9
    iget-object v4, p0, Les/n40;->a:Les/td0;

    iget-wide v5, p0, Les/n40;->c:J

    move-object v7, p1

    move v8, p2

    move v9, p3

    invoke-virtual/range {v4 .. v9}, Les/td0;->a(J[BII)I

    move-result p1

    goto :goto_0

    .line 10
    :cond_3
    iget-object p3, p0, Les/n40;->a:Les/td0;

    iget-wide v4, p0, Les/n40;->c:J

    long-to-int v7, v2

    move-object v2, p3

    move-wide v3, v4

    move-object v5, p1

    move v6, p2

    invoke-virtual/range {v2 .. v7}, Les/td0;->a(J[BII)I

    move-result p1

    :goto_0
    if-ltz p1, :cond_4

    .line 11
    iget-wide p2, p0, Les/n40;->d:J

    int-to-long v2, p1

    add-long/2addr p2, v2

    iput-wide p2, p0, Les/n40;->d:J

    .line 12
    iget-wide p2, p0, Les/n40;->c:J

    add-long/2addr p2, v2

    iput-wide p2, p0, Les/n40;->c:J

    .line 13
    :cond_4
    new-instance p2, Ljava/lang/StringBuilder;

    invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V

    const-string p3, "readed return:"

    invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p2, p1}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    invoke-static {v1, p2}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V

    .line 14
    new-instance p2, Ljava/lang/StringBuilder;

    invoke-direct {p2}, Ljava/lang/StringBuilder;-><init>()V

    const-string p3, "total readed:"

    invoke-virtual {p2, p3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    iget-wide v2, p0, Les/n40;->d:J

    invoke-virtual {p2, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    invoke-virtual {p2}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p2

    invoke-static {v1, p2}, Lcom/estrongs/android/util/n;->b(Ljava/lang/String;Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/io/IOException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    return p1

    .line 15
    :catch_0
    new-instance p1, Ljava/io/IOException;

    invoke-direct {p1}, Ljava/io/IOException;-><init>()V

    throw p1

    :catch_1
    move-exception p1

    .line 16
    throw p1

    .line 17
    :cond_5
    new-instance p1, Ljava/io/IOException;

    const-string p2, "IndexOutOfBounds"

    invoke-direct {p1, p2}, Ljava/io/IOException;-><init>(Ljava/lang/String;)V

    throw p1
.end method
